"""
效验绩效
"""
import os
import sys
import django

base_url = os.path.split(os.path.split(os.getcwd())[0])[0]
print(base_url)
sys.path.insert(0, os.path.split(os.path.split(os.getcwd())[0])[0])
os.environ['DJANGO_SETTINGS_MODULE'] = 'finance_c2c.settings'
django.setup()

from apps.supply_order.models import WomaiChildOrder

from django.contrib.auth import get_user_model

userModel = get_user_model()


def validate_perf():
    child_orders = WomaiChildOrder.objects.exclude(wm_order__supply_order__wx_pay_type=0).exclude(after_sale=4)
    for i in child_orders:
        i.wm_order.supply_order.user.update_user_perf(i.total_fee)


if __name__ == '__main__':
    validate_perf()
